Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build examples using find_package #324

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

jean-roland
Copy link
Contributor

This fixes issue #278, the examples can now build in standalone with a preinstalled zenohpico library.

examples/CMakeLists.txt Outdated Show resolved Hide resolved
@milyin
Copy link
Contributor

milyin commented Jan 22, 2024

Obsolete add_definitions (https://cmake.org/cmake/help/latest/command/add_definitions.html) in examples/CMakeLists.txt is not the right way to fix the issue.
Build fails when including zenoh-pico as a package. This happens because the package installation is not correct, not because some settings were forgotten. Necessary settings should come from installed package without bothering the user.

You need to add target_compile_definitions (https://cmake.org/cmake/help/latest/command/target_compile_definitions.html#command:target_compile_definitions) to this file: https://github.com/eclipse-zenoh/zenoh-pico/blob/main/PackageConfig.cmake.in

Look as an example to https://github.com/eclipse-zenoh/zenoh-cpp/blob/main/install/PackageConfig.cmake.in#L23

@Mallets Mallets added the bug Something isn't working label Jan 24, 2024
@Mallets Mallets linked an issue Jan 24, 2024 that may be closed by this pull request
@Mallets Mallets linked an issue Jan 24, 2024 that may be closed by this pull request
@Mallets Mallets linked an issue Jan 24, 2024 that may be closed by this pull request
@jean-roland jean-roland mentioned this pull request Jan 26, 2024
@jean-roland
Copy link
Contributor Author

For now we should merge the fix and make the deeper rework on CMake mentioned by @milyin at a later date, created issue #332 for this purpose.

@Mallets Mallets merged commit d7269a9 into eclipse-zenoh:main Jan 26, 2024
48 checks passed
@jean-roland jean-roland deleted the fix_cmake branch February 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

failed to use find_package(zenohpico) [Bug]
4 participants